#if 1
//RBtree test
#include<iostream>
//#include<vld.h>
#include"RBTree.h"
#include"RBTree.cpp"

using namespace std;

int main()
{
	int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
	int arr1[] = { 53, 78, 17, 65, 45, 9, 87, 23, 81, 94, 88 };
	int len = sizeof(arr) / sizeof(arr[0]);

	RBTree<int> rb;
	for (int i = 0; i < len; i++)
	{
		rb.Insert(arr[i]);
		if (rb.Is_BSTTree(rb.GetHead()->parent)) cout << " is BSTTree ";
		else cout << " is not BSTTree ";
		if (rb.Is_RBTree(rb.GetHead()->parent)) cout << "is RBTree" << endl;
		else cout << "is not RBTree" << endl;
	}

	cout << "rbtree size : " << rb.GetSize() << endl;
	rb.InOrder(rb.GetHead()->parent); cout << endl;
	rb.NoRecInOrder();
	rb.MirrorNoRecInOrder();

	RBNode<int>* rbnode = rb.FindValue(rb.GetHead()->parent, 81);
	if(rbnode != nullptr) cout << "FindValue : " << rbnode->key << endl;

	rbnode = rb.NoRecFindValue(9);
	if (rbnode != nullptr) cout << "NoRecFindValue : " << rbnode->key << endl;

	system("pause");
	return 0;
}
#endif